You are here: TI-Nspire™ Technology Program Editor eGuide > TI-Nspire™ Technology Program Editor Guide > Getting Started with the Program Editor > Displaying Information

Displaying Information from a Function or Program

A running function or program does not display intermediate calculated results unless you include a command to display them. This is an important difference between performing a calculation on the entry line and performing it in a function or program.

The following calculations, for example, do not display a result in a function or program (although they do from the entry line).

 ©

x:=126

cos(π/4)

 ©

Displaying Information in the History

You can use the Disp command in a program or function to display information, including intermediate results, in the history.

 ©

Disp 126

Disp "Result:",cos(π/4)

 ©

Displaying Information in a Dialog Box

You can use the Text command to pause a running program and display information in a dialog box. The user clicks OK to continue or clicks Cancel to stop the program.

You cannot use the Text command in a function.

 ©

Text "Area=" & area

 ©

Note: Displaying a result with Disp or Text does not store that result. If you expect to refer later to a result, store it to a global variable.

 ©

cos(π/4)maximum

Disp maximum

 ©